<h1>Listing books</h1>

<table>
  <tr>
    <th>Title</th>
    <th>Description</th>
    <th>Author</th>
    <th>Code</th>
    <th>Quantity</th>
    <th>Current quantity</th>
    <th>Category</th>
    <th>Price</th>
    <th>Image url</th>
    <th>Numviewed</th>
    <th>Numborrowed</th>
    <th></th>
    <th></th>
    <th></th>
  </tr>

<% @books.each do |book| %>
  <tr>
    <td><%= book.title %></td>
    <td><%= book.description %></td>
    <td><%= book.author %></td>
    <td><%= book.code %></td>
    <td><%= book.quantity %></td>
    <td><%= book.current_quantity %></td>
    <td><%= book.category_id %></td>
    <td><%= book.price %></td>
    <td><%= book.image_url %></td>
    <td><%= book.numviewed %></td>
    <td><%= book.numborrowed %></td>
    <td><%= link_to 'Show', book %></td>
    <td><%= link_to 'Edit', edit_book_path(book) %></td>
    <td><%= link_to 'Destroy', book, method: :delete, data: { confirm: 'Are you sure?' } %></td>
  </tr>
<% end %>
</table>

<br />

<%= link_to 'New Book', new_book_path %>
